#ifndef Normal_Task_Trigger_h
#define Normal_Task_Trigger_h

#include "TaskTrigger.h"
#include <stdlib.h>

namespace serika
{
	namespace ut
	{
		class NormalTaskTrigger : public TaskTrigger
		{
		public:
			NormalTaskTrigger(size_t start, size_t end, size_t loopInterval);
			virtual ~NormalTaskTrigger();

		public:
			virtual bool CanExecute(const Clock& clock);
			virtual bool CanTerminate(const Clock& clock) const;

		protected:
			void Init(const Clock& clock);

			virtual size_t GetCurr(const Clock& clock) const = 0;

			void CalcNextStart(const Clock& clock);

		protected:
			size_t mStart;
			size_t mEnd;
			size_t mLooInterval;
			bool mInit;
			bool mInfinity;
		};
	}
}

#endif
